home *** CD-ROM | disk | FTP | other *** search
Wrap
property pScriptMember, pCastLibrary, pColorTable, ancestor global gScriptOMaticCurrentFormatTable, gScriptOMaticMasterColorTable on new me, scriptMember, castLibrary, scriptText, handlerNamelist set the pScriptMember of me to scriptMember set the pCastLibrary of me to castLibrary set the pColorTable of me to duplicate(gScriptOMaticMasterColorTable) set the ancestor of me to new(script "ScriptParser", the pScriptMember of me, the pCastLibrary of me, scriptText, handlerNamelist) return me end on scriptFace faceType case the platform starts "M" of 1: case faceType of "Monospaced": return "Monaco" "Proportional": return "Times" end case 0: case faceType of "Monospaced": return "Arial" "Proportional": return "Times New Roman" end case end case return faceType end on formatScript me startFormatToScript(me) set styleRunList to [#styles: [#plain], #face: scriptFace("Monospaced"), #size: 9, #Color: [0, 0, 0], #characterRuns: []] setaProp(styleRunList, #characterRuns, [[1, 99999]]) applyFormatToScript(me, styleRunList, "default styles") set formatTable to the commentsFormat of gScriptOMaticCurrentFormatTable if the activate of formatTable and (count(the pCommentRuns of me) > 0) then set Color to getaProp(the pColorTable of me, symbol(the Color of formatTable)) set style to list(symbol(the style of formatTable)) set face to scriptFace(the face of formatTable) set styleRunList to [#styles: style, #face: face, #size: value(the size of formatTable), #Color: Color, #characterRuns: []] setaProp(styleRunList, #characterRuns, the pCommentRuns of me) applyFormatToScript(me, styleRunList, "comments") end if set formatTable to the globalDeclarationsFormat of gScriptOMaticCurrentFormatTable if the activate of formatTable and (count(the pGlobalDeclarationRuns of me) > 0) then set Color to getaProp(the pColorTable of me, symbol(the Color of formatTable)) set style to list(symbol(the style of formatTable)) set face to scriptFace(the face of formatTable) set styleRunList to [#styles: style, #face: face, #size: value(the size of formatTable), #Color: Color, #characterRuns: []] setaProp(styleRunList, #characterRuns, the pGlobalDeclarationRuns of me) applyFormatToScript(me, styleRunList, "global declarations") end if set formatTable to the propertyDeclarationsFormat of gScriptOMaticCurrentFormatTable if the activate of formatTable and (count(the pPropertyDeclarationRuns of me) > 0) then set Color to getaProp(the pColorTable of me, symbol(the Color of formatTable)) set style to list(symbol(the style of formatTable)) set face to scriptFace(the face of formatTable) set styleRunList to [#styles: style, #face: face, #size: value(the size of formatTable), #Color: Color, #characterRuns: []] setaProp(styleRunList, #characterRuns, the pPropertyDeclarationRuns of me) applyFormatToScript(me, styleRunList, "property declarations") end if set formatTable to the handlerDeclarationsFormat of gScriptOMaticCurrentFormatTable if the activate of formatTable and (count(the pHandlerDeclarationRuns of me) > 0) then set Color to getaProp(the pColorTable of me, symbol(the Color of formatTable)) set style to list(symbol(the style of formatTable)) set face to scriptFace(the face of formatTable) set styleRunList to [#styles: style, #face: face, #size: value(the size of formatTable), #Color: Color, #characterRuns: []] setaProp(styleRunList, #characterRuns, the pHandlerDeclarationRuns of me) applyFormatToScript(me, styleRunList, "handler declarations") end if set formatTable to the localDeclarationsFormat of gScriptOMaticCurrentFormatTable if the activate of formatTable and (count(the pLocalDeclarationRuns of me) > 0) then set Color to getaProp(the pColorTable of me, symbol(the Color of formatTable)) set style to list(symbol(the style of formatTable)) set face to scriptFace(the face of formatTable) set styleRunList to [#styles: style, #face: face, #size: value(the size of formatTable), #Color: Color, #characterRuns: []] setaProp(styleRunList, #characterRuns, the pLocalDeclarationRuns of me) applyFormatToScript(me, styleRunList, "local declarations") end if set formatTable to the globalVariablesFormat of gScriptOMaticCurrentFormatTable if the activate of formatTable and (count(the pGlobalVariableRuns of me) > 0) then set Color to getaProp(the pColorTable of me, symbol(the Color of formatTable)) set style to list(symbol(the style of formatTable)) set face to scriptFace(the face of formatTable) set styleRunList to [#styles: style, #face: face, #size: value(the size of formatTable), #Color: Color, #characterRuns: []] setaProp(styleRunList, #characterRuns, the pGlobalVariableRuns of me) applyFormatToScript(me, styleRunList, "global references") end if set formatTable to the propertyVariablesFormat of gScriptOMaticCurrentFormatTable if the activate of formatTable and (count(the pPropertyVariableRuns of me) > 0) then set Color to getaProp(the pColorTable of me, symbol(the Color of formatTable)) set style to list(symbol(the style of formatTable)) set face to scriptFace(the face of formatTable) set styleRunList to [#styles: style, #face: face, #size: value(the size of formatTable), #Color: Color, #characterRuns: []] setaProp(styleRunList, #characterRuns, the pPropertyVariableRuns of me) applyFormatToScript(me, styleRunList, "property references") end if set formatTable to the handlerNamesFormat of gScriptOMaticCurrentFormatTable if the activate of formatTable and (count(the pHandlerNameRuns of me) > 0) then set Color to getaProp(the pColorTable of me, symbol(the Color of formatTable)) set style to list(symbol(the style of formatTable)) set face to scriptFace(the face of formatTable) set styleRunList to [#styles: style, #face: face, #size: value(the size of formatTable), #Color: Color, #characterRuns: []] setaProp(styleRunList, #characterRuns, the pHandlerNameRuns of me) applyFormatToScript(me, styleRunList, "handler references") end if set formatTable to the localVariablesFormat of gScriptOMaticCurrentFormatTable if the activate of formatTable and (count(the pLocalVariableRuns of me) > 0) then set Color to getaProp(the pColorTable of me, symbol(the Color of formatTable)) set style to list(symbol(the style of formatTable)) set face to scriptFace(the face of formatTable) set styleRunList to [#styles: style, #face: face, #size: value(the size of formatTable), #Color: Color, #characterRuns: []] setaProp(styleRunList, #characterRuns, the pLocalVariableRuns of me) applyFormatToScript(me, styleRunList, "local references") end if endFormatToScript(me) end on startFormatToScript me tell the stage scolUseThisMovie() end tell tell the stage scolUseCastLib(the pCastLibrary of me) end tell tell the stage set scolResult to scolUseMember(the pScriptMember of me) end tell if scolResult = "OK" then else alert("Sorry, a fatal error occurred:" && scolResult & RETURN & "when processing member" && the pScriptMember of me && "in castLib" && the pCastLibrary of me) closeScriptOMatic() end if end on applyFormatToScript me, styleSpecifications, stylingComment tell the stage set scolResult to scolSetScriptStyles(styleSpecifications) end tell if scolResult = "OK" then exit else alert("Sorry, a minor error occurred:" && scolResult & RETURN & "when styling the" && stylingComment && "of member" && the pScriptMember of me && "in castLib" && the pCastLibrary of me) exit end if end on endFormatToScript me tell the stage set scolResult to scolCommitChanges() end tell if scolResult = "OK" then else alert("Sorry, a minor error occurred:" && scolResult & RETURN & "when processing member" && the pScriptMember of me && "in castLib" && the pCastLibrary of me) end if tell the stage scolReleaseCastLib() end tell tell the stage scolReleaseMovie() end tell end